package com.ugrow.Study_System.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.TextView;

import com.ugrow.Study_System.R;

/**
 * Created by zhou on 2018/10/15.
 */
public class HerosAdaper extends BaseAdapter {
    private Context mContext;
//    private List<String> mList;
    private String[] herosName;
    public HerosAdaper(Context context,String[] herosName){
//        this.mList = list;
        this.herosName = herosName;
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return herosName.length;
    }

    @Override
    public Object getItem(int i) {
        return null;
    }

    @Override
    public long getItemId(int i) {
        return 0;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = View.inflate(mContext, R.layout.item_heros,null);

        }
        TextView nameTv = (TextView) view.findViewById(R.id.item_heros_name_tv);
        String nameStr = herosName[i];
        nameTv.setText(nameStr);

//        view.setVisibility(i);

        return view;
    }
}
